const mongoose = require('mongoose')
const Schema = mongoose.Schema

const userSchema = new mongoose.Schema({
    email:{
        type: String, required: true,
        match: /^[a-zA-Z0-9_]{3,20}@[a-zA-Z0-9_.]+/
    },
    username:{
        type: String, required: true,
        maxlength: 36
    },
    nickname: {
        type: String, required: true,
        maxlength: 36
      },
    password:{
        type: String, required: true,
        maxlength: 36
    }
})

mongoose.model('User', userSchema, 'user')